<template>
	<view >
	 你好

	</view>
</template>

<script setup>
	import {
		onLoad,
		onReachBottom,
		onPullDownRefresh,
		onShow,
		onHide, onPageScroll
	} from '@dcloudio/uni-app';
	import { ref, reactive } from 'vue';
	// import { counterStore } from '@/store/index.js';
	// import { aa } from '@u/index.js';
	// import customTabbar from '@c/customTabbar/customTabbar';    
	onLoad(() => {
		console.log('首页11')
		uni.scanCode({
			success: function (res) {
				console.log('res：' + JSON.stringify(res) ); 
			}
		});
	});
	const tabsList = reactive([{
			name: '全部'
		},
		{
			name: '商品券'
		},
		{
			name: '代金券'
		},
		{
			name: '甄选商城'
		}
	]);

	const baseList = ref([{
			name: 'photo',
			title: '图片'
		},
		{},
		{},
		{},
		{},
		{},
		{},
		{},
		{}, {}
	]);

	const show = ref(false);
	
	const bgColor = ref('transparent');
	
	
	onPageScroll(e => {
		console.log('e.scrollTop  ',e.scrollTop  ) 
		if(e.scrollTop < 20){
			bgColor.value = 'transparent'
		}else{
			bgColor.value = '#f9e4d4'
		}
	})  
	// 创建对子组件的引用  
	// const uToastRef = ref(null);  

	// 定义方法  
	// const click = (name) => {  
	//     if (uToastRef.value) {  
	//         uToastRef.value.success(`点击了第${name}个`);  
	//     }  
	// };  
	// const rightClick = () => {  
	//     console.log('rightClick');  
	// };  

	// const leftClick = () => {  
	//     console.log('leftClick');  
	// };  
	
	const gridupItemClick = (item) => {
		console.log('click',item);
		uni.navigateTo({
			url:'./exchange/details'
		})
	};
	
	const click = () => {
		console.log('click');
	};

	console.log('首页22')
	let count = ref(0)
	let current = ref(0)
	// const counter = counterStore();

	const change = () => {
		console.log('change................')

	}
	const fn = () => {
		console.log('fnfnfnfn................')
		// aa()
		count.value++;
	}

	const handleAdd = () => {
		// counter.increment()
	}
	// 上拉加载更多
	onReachBottom(() => {
		// loadMore();
		console.log('onReachBottom...')
	});

	//下拉刷新
	onPullDownRefresh(() => {
		console.log('onPullDownRefresh...')
		// getGrouponList();
		// setTimeout(function () {
		//   uni.stopPullDownRefresh();
		// }, 800);
	});
</script>

<style scoped lang="scss">
	 
</style>